package com.hollycrm.ahunicom.sheet.business.hibernate;

import java.util.Iterator;
import java.util.List;

import org.springframework.orm.hibernate.HibernateCallback;
import org.springframework.orm.hibernate.HibernateTemplate;
import org.springframework.orm.hibernate.support.HibernateDaoSupport;

import com.hollycrm.ahunicom.sheet.business.BusinessSupportManagerDefine;
import com.hollycrm.ahunicom.sheet.domain.SpRefundment;
import com.hollycrm.ahunicom.sheet.lightweight.SpRefundmentInfo;
import com.hollycrm.unicom.sheet.business.hibernate.HibernateBusinessSupportHelper;
import com.hollycrm.unicom.sheet.domain.AcceptRecord;
import com.hollycrm.unicom.sheet.domain.AnswerRecord;
import com.hollycrm.unicom.sheet.domain.ConfirmSheet;
import com.hollycrm.unicom.sheet.domain.DealSheet;
import com.hollycrm.unicom.sheet.domain.MainSheet;
import com.hollycrm.unicom.sheet.domain.SheetAppu;
import com.hollycrm.unicom.sheet.domain.SheetCustomerInfo;
import com.hollycrm.unicom.sheet.domain.SheetModifyHistory;
import com.hollycrm.unicom.sheet.domain.SheetRoutineNote;
import com.hollycrm.unicom.sheet.lightweight.IAcceptRecord;
import com.hollycrm.unicom.sheet.lightweight.IConfirmSheet;
import com.hollycrm.unicom.sheet.lightweight.IDealSheet;
import com.hollycrm.unicom.sheet.lightweight.IMainSheet;
import com.hollycrm.unicom.sheet.lightweight.ISheetCustomerInfo;
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.Session;

/**
 * HibernateBusinessSupportManagerDefine
 *
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author Tian Kai
 * @version 1.0
 */
public class HibernateBusinessSupportManagerDefine
    extends HibernateDaoSupport
    implements BusinessSupportManagerDefine {
    public HibernateBusinessSupportManagerDefine() {
    }

	public List listSpRefundment(final String sheetFlowNO) {
		HibernateTemplate ht = getHibernateTemplate();
        return (List) ht.execute(new HibernateCallback() {
            /**
             * doInHibernate
             *
             * @param session Session
             * @return Object
             * @throws HibernateException
             */
            public Object doInHibernate(Session session) throws
                HibernateException {
                return HibernateBusinessSupportHelperDefine.listSpRefundment(session,
                    getHibernateTemplate(),
                    sheetFlowNO, SpRefundment.class);
            }
        });
	}

	public SpRefundmentInfo getSpRefundmentInfo(final String spRefundmentNo) {
		HibernateTemplate ht = getHibernateTemplate();
        return (SpRefundmentInfo)ht.execute(new HibernateCallback() {
            /**
             * doInHibernate
             *
             * @param session Session
             * @return Object
             * @throws HibernateException
             */
            public Object doInHibernate(Session session) throws
                HibernateException {
                return HibernateBusinessSupportHelperDefine.getSpRefundmentInfo(session,
                    getHibernateTemplate(),
                    spRefundmentNo, SpRefundmentInfo.class);
            }
        });
	}

    
}

